package main

import (
"fmt"
"strings"
)

func main() {
	query := "SELECT column_name, data_type FROM user_tab_columns WHERE table_name = 'TREAT_PREF_TREATMENT'"
	limit := 10
	
	// 模拟处理逻辑
	cleanQuery := strings.TrimSuffix(strings.TrimSpace(query), ";")
	finalQuery := fmt.Sprintf("SELECT * FROM (%s) WHERE ROWNUM <= %d", cleanQuery, limit)
	
	fmt.Printf("原始查询: %s\n", query)
	fmt.Printf("清理后查询: %s\n", cleanQuery)
	fmt.Printf("最终查询: %s\n", finalQuery)
}
